package com.me.model;

//吕旺平
public abstract class Item {
	protected int id;
	protected String title;
	protected String[] contents;
	protected int score;
	protected int answerId;
	protected int chooseId;
	protected boolean multiple;
	
	public Item() {
	}
	
	public Item(String title, String[] contents, int score, String answer) {
		this(title,contents,score,answer,false);
	}
	
	public Item(String title, String[] contents, int score, String answer, boolean multiple) {
		this.title = title;
		this.contents = contents;
		this.score = score;
		setAnswer(answer);
		this.multiple = multiple;
		chooseId = -1;
	}
	
	@Deprecated
	public Item(int id, String title, String[] contents, int score, int answerId, boolean multiple) {
		this.id = id;
		this.title = title;
		this.contents = contents;
		this.score = score;
		this.answerId = answerId;
		this.multiple = multiple;
		chooseId = -1;
	}
	
	@Deprecated
	public Item(int id, String title, String[] content, int score, int answerId) {
		this(id, title, content, score, answerId, false);
	}
	
	@Deprecated
	public Item(int id, String title, String[] content, int score, String answer) {
		this(id, title, content, score, answer, false);
	}
	
	//使用DBUtil之前处理数据库数据构造函数
	@Deprecated
	public Item(int id, String title, String content, int score, String answer, boolean multiple) {
		this(id, title, content.substring(1, content.length() - 1).split(","), score, answer, multiple);
	}
	
	@Deprecated
	public Item(int id, String title, String[] content, int score, String answer, boolean multiple) {
		this(id, title, content, score, 0, multiple);
		setAnswer(answer);
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String[] getContents() {
		return contents;
	}
	
	public void setContents(String[] contents) {
		this.contents = contents;
	}
	
	public int getScore() {
		return score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}
	
	public int getAnswerId() {
		return answerId;
	}
	
	public void setAnswerId(int answerId) {
		this.answerId = answerId;
	}
	
	public int getChooseId() {
		return chooseId;
	}
	
	public void setChooseId(int chooseId) {
		this.chooseId = chooseId;
	}
	
	public boolean isMultiple() {
		return multiple;
	}

	public boolean getMultiple() {
		return multiple;
	}
	
	public void setMultiple(boolean multiple) {
		this.multiple = multiple;
	}
	
	public abstract void setContent(String content);
	
	public abstract String getTitle(int id);
	
	public abstract void setAnswer(String answer);
	
	public abstract String getAnswer();
	
	public abstract boolean isRight();
	
	public abstract int getValue(int id);
	
	public abstract boolean isChecked(int id);
	
	public abstract int getChooseItemCount();
	
	public abstract String getChooseItemDescribe(int id);

	public abstract String getAllChooseItemDescribe();
}